<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<% String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
        + request.getContextPath() + "/";
      String code= request.getParameter("code");
      String[] codes=code.split(",");
      String obj="";
      for(int i=0;i<codes.length;i++){
          obj=obj+"&"+codes[i];
      }
     obj= obj.replace(":","=");
    String ym= request.getParameter("ym");
    ym=ym+"##"+obj;


%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <base href="<%=basePath %>">
    <script src="statics/js/login/jquery.min.js"></script>

</head>

<body style="width: 100%;height: 100%">

<input type="hidden" id="report" value="<%=ym %>">

<iframe id="reporturl" style=" width: 100%; height: 600px;frameborder:'no'">

</iframe>
</body>
</html>
<script>
    var reporturl=getReportUrl();
    reporturl="http://localhost:6001/quiee/reportJsp/showReport.jsp?raq=/";
    var srcs=$("#report").val();
    var objs=srcs.split("##");
    var url="";
    if(objs.length==2){
        url=reporturl+objs[0]+".raq"+objs[1];
    }else{
        url=reporturl+objs[0]+".raq";
    }

    $("#reporturl")[0].src=url;

    //获取字典
    function getdictionary(dl,xl) {
        var obj=[];
        $.ajax({
            type : 'POST',
            //  url : 'resource/getTree',
            data: {"type":dl,"lx":xl},
            url:'dictionary2/getValues',
            dataType:"json",
            // contentType: 'application/json',
            async:false,
            success : function (da) {
                if(da.status==200 ){
                    obj=da.data;
                }
            },
            error: function(data) {
                // layer.msg("获取失败!");
            }
        });
        return obj;
    }
    //获取报表url前缀
    function  getReportUrl() {
         var url=getdictionary(6,54);
         return url[1].name;
    }

</script>

